import axios from 'axios'
import apiMap from './apiMap'

const http = axios.create({
    // baseURL: 'http://127.0.0.1',
    timeout: 100000,
})
http.interceptors.request.use(config => {
    console.log('请求拦截', config)
    return config
})

http.interceptors.response.use(config => {
    console.log('响应拦截')
    return config
})

export default {
    getList(params: any = {}, headers: any = {}): Promise<any> {
        return http.request({ ...apiMap.getList, params, headers })
    }
}
